Salesforce Response Mapping
About Response Mapping
Response Mapping is used to take the answers provided in a Qualtrics survey and map them back to a Salesforce record. For example, when your client takes a support feedback survey, their satisfaction level could be mapped back to Salesforce for the account manager to see.
Insert, Update, Upsert, Delete, and Post to Chatter
When setting up Response Mapping, you will have the option to create, update, and delete records, in addition to posting to chatter for each survey response.
INSERT
The Insert option allows you to have a new record created in Salesforce each time a response is submitted. This allows respondents to complete the survey multiple times without overriding their previous answers. For more details on how we recommend setting up your Salesforce environment to optimize the data you get from an insert mapping, see our Salesforce Best Practices support page.
In this example, the contact record is not modified, but rather a new Survey Response record is created each time the survey is completed and then tied back to their contact record.
UPDATE
The Update option is useful for updating out of date information on an existing contact record. This may be used to track the most recent response to a survey or to keep up to date contact and demographic information.
In this example, the existing contact record is modified to include the client’s latest satisfaction score, as well as their most recent comments.
When using Response Mapping to update a Salesforce object, Qualtrics requires that a unique key field be set so that Salesforce can identify which object record to update. For more information on this, check out the section on Setting a Key below.
UPSERT
The Upsert feature searches for an existing record of the specified object in Salesforce to update if a record with the specified ID exists in Salesforce. If this record does not exist in Salesforce at the time the workflow is being executed, the integration will create a new record. This is especially useful if you may be surveying existing contacts and potential new leads. Similar to the update option, upserting requires a unique Key.
DELETE
The Delete option is appropriate when you would like to remove certain Salesforce records from an object. Just like when you’re updating a record, a unique Key is required to identify which record in Salesforce to delete.
POST TO CHATTER
The Post to Chatter option allows you to send a message to a feed in Salesforce. This can be done on a user or object level.
Setting Up Response Mapping
Once you have determined the type of mapping you would like to do, check to make sure the appropriate object and its fields are created in Salesforce. Once this is confirmed, you are ready to begin creating the Response Mapping.
- Open your survey and navigate to the Workflows tab.
- Click Create a workflow.
- Choose Event-based.
- For the workflow’s event, choose the survey response event, since Salesforce Response Mapping is triggered by the submission of a survey.
- If desired, click the plus sign ( + ) and then Conditions to add conditions to your workflow.
- Click the plus sign ( + ) and then Task.
- Select the Salesforce task.
- Choose the type of action to take in Salesforce. See Insert, Update, Upsert, Delete, and Post to Chatter for more information about each action.
- Click Next.
- Choose the Salesforce account to use.
Qtip: Alternatively, click Add a user account to connect a Salesforce account. See Linking Qualtrics and Salesforce for more information. - Click Next.
- Choose your Salesforce Object to map to.
- Add the Salesforce fields to map to and the Qualtrics value to map to each field. If your Action on Record is Update, Upsert, or Delete, specify your key field as well. Use the piped text menu, {a}, to pull in values from your survey.
- To add additional fields, click Add new field.
- Ensure that the option Apply Salesforce assignment rules is enabled to apply assignment rules set up within Salesforce. This setting is enabled by default.
- If you’d like to receive notification emails when this workflow runs, enter your email address.
Qtip: This option will only appear for legacy workflows that already had a notification email configured. If you do not see this option but would like to be notified when this workflow runs, use Workflow Notifications. - When finished, click Save.
Setting a Key
A Key needs to be included in the Response Mapping when a record is being updated, upserted, or deleted. The Key will identify which existing record needs to be changed. In most situations a Key will be an ID. Common examples include a Contact ID or a Case ID. Chances are your participants won’t know this Salesforce ID, so asking for it in a survey question won’t be practical.
How you retrieve the Key will depend on how the survey was distributed.
TO RETRIEVE A KEY USING TRIGGER AND EMAIL SURVEY
If your survey is distributed using Trigger and Email Survey, the appropriate Key can be saved as Embedded Data in a Contact List. This Key will then be available for mapping.
- Open your survey and navigate to the Workflows tab.
- If this is your first time triggering and emailing a survey, please see the Triggering & Emailing Surveys page. Otherwise, please create or select a workflow with the Event set to a Salesforce Workflow Rule.
- Click your new Salesforce Workflow Rule Event.
- Utilize the Included fields from Salesforce to identify the desired Key field for your object. You can also use Add fields to manually map the field into Qualtrics.
- When finished, click Done.
- Click the plus sign ( + ) and then Task.
- Choose XM Directory.
- If you want to send out a survey distribution to your contact automatically, select Distribute Survey. If you simply want to save the contact’s Salesforce data in Qualtrics (and distribute your survey at a later time), click Add to XM Directory.
- Under the Contact List dropdown, select a contact list or create a new one where this information will be stored. Fill out the rest of the task as demonstrated on the XM Directory Task page.
- Choose Add or remove embedded data fields to map the Key field into a contact embedded data field.
- A window will appear where you can set embedded data fields. On the left, name the embedded data fields under Embedded Data Field. On the right, populate them with Salesforce field values under Field Values. This will save the data with the contact entry in Qualtrics.
- Select Close, then Save on your XM Directory task.
- Return to the Survey tab.
- Select Survey flow.
- Select Add a New Element Here.
- Select Embedded Data.
- Type in the name of the Embedded Data field that your Key field is set to in your contact list from Step 11.
- Select Save Flow.
- Navigate back to the Workflows tab and go to your Response Mapping task.
- Select the Salesforce field for the Key. In most cases, this will be the Record ID from Salesforce.
- Set the Key as an Embedded Data field.
- Use the dropdown to choose the Embedded Data field name that matches the Contact List in Step 11 and from the Survey Flow in Step 17.
- Click Save.
TO RETRIEVE A KEY USING EMAIL SURVEY
If your survey was distributed using the Qualtrics mailer, the appropriate Key can be uploaded as part of the Contact List.
- When uploading the Contact List, include a column for the appropriate Key.
Qtip: To retrieve a spreadsheet of IDs for each participant, ask your Salesforce Administrator to perform a data export of the appropriate Salesforce records. - Select Survey Flow.
- Select Add a New Element Here.
- Select Embedded Data.
- Paste the Embedded Data field name from step 1. Keep in mind that the field names must match in capitalization and spacing.
- Select Save Flow.
- Navigate to your Response Mapping workflow.
- Select the Salesforce field for the Key. In most cases, this will be the Record ID from Salesforce.
- Set the Key as an Embedded Data field.
- Use the Embedded Data field name from the Contact List.
- Select Save.
Mapping a Lookup Field
When creating custom fields for your object in Salesforce, one optional field type is a Lookup Field. A Lookup Field is used to connect two objects in Salesforce in a parent-child relationship. When using Response Mapping, a Lookup Field can be used to insert a new record in one object and then connect that newly inserted record to another object, the parent object. For more information, view Create Custom Fields on the Salesforce support site. Once set up in Salesforce, Lookup Fields can be used in Response Mapping.
In this example, the Survey Response will be related to the Contact that triggered the survey, as well as the Contact’s parent Account.
Mapping to Common Salesforce Fields
Each type of Salesforce field can only accept data in a specific format. It’s important to know what these types of data are as you set up your Response Mapping. If your mapping is working for the most part, but one or more fields aren’t updating, it’s likely that you’re passing the wrong type of data.
This guide also contains suggestions for which question types to pair with each type of field in Salesforce. It’s a good idea to first think about how you want your data to be stored in Salesforce, then to design your survey to match that data. For example, if you want to use a checkbox in Salesforce, consider using a Yes/No multiple choice question in Qualtrics.
LOOKUP FIELD
Lookup Fields can only accept the unique Salesforce Record ID of the record you want to reference. This record ID will usually be stored as Embedded Data, either from a Contact List or from a query string if you’ve set up a custom link in Salesforce.
- If you are distributing through a link generated in Salesforce, make sure the Embedded Data names specified in your mapping match the names you set in your query strings when creating the link.
- If you are distributing to a Contact List in Qualtrics, make sure the Embedded Data names used in the mapping match the Embedded Data column headers from the file you used to create your contact list.
- If you are distributing through the Salesforce App, the Salesforce contact ID and account ID should be labeled as sfSurveyId and sfContactId. For more information on pulling data from into Qualtrics using the Salesforce app, visit our page on The New Salesforce App Experience.
TEXT
Text fields are extremely flexible in what they will accept. In general, they are best when used with a regular text entry question. When setting up the mapping, map information from your text entry question and select the bottom option from the final dropdown menu.
CHECKBOX
A checkbox can only be in one of two states – checked or unchecked. To map these respective states, you can use the values below:
- true for Checked or false for Unchecked
- 1 for Checked or 0 for Unchecked
If you’re using a Yes/No multiple choice question, consider using Selected Choices – Recode Values when creating your mapping and then recoding the values of the answer choices to match the checkbox state you’re looking for. If you’re using a Multiple Choice – Multiple Answer type question, you’ll likely want to use Branch Logic for each possible answer choice in the question, then setting an Embedded Data value equal to one when an answer is selected. From there, select Embedded Data and the name of your Embedded Data field when creating the mapping for each respective checkbox.
PICKLIST
To map to a picklist, simply map the text of the option you want to select, sent over as a string. For example, if I have a picklist with “Red,” “Green,” and “Blue” in Salesforce, I would map “Red” if I wanted to select Red in the picklist.
The best question type to use for a picklist is a Single Answer multiple choice question. For a multi-select picklist in Salesforce, consider using the Multiple Choice – Multiple Answer question type in Qualtrics. To make the setup easier, make sure to match the text of the multiple choice question and the picklist options. When creating the mapping, select Selected Choices when mapping to your picklist.
DATE
The Date field type will accept a wide range of possible date formats. These include (but aren’t necessarily limited to):
- M/D/YYYY
- YYYY-M-D
- MM/DD/YYYY
- YYYY/DD/MM
- [Full month name] D, YYYY
The most common use case for mapping a date is recording the last time a participant completed a survey. To record this, consider adding a DateCompleted Embedded Data field to the end of your Survey Flow and use our Piped Text menu to insert one of the date formats listed above. When setting up the Response Mapping, select your date field followed by Embedded Data equal to DateCompleted.
If you want to capture the date that a survey was sent, consider adding a Flow action that updates a field on the object with the date the Flow was triggered.
Mapping a Response Report Link
Response Mapping involves saving survey responses to fields of a Salesforce record. While having each question saved to Salesforce opens up dashboarding and reporting possibilities, in some situations it may be preferable to keep the response data in Qualtrics and simply map a link to the response into Salesforce.
In this example, a link to the survey response is mapped to Salesforce and the link is clickable.
TO MAP A RESPONSE REPORT LINK
- Go to Response Mapping.
- Select a Salesforce field to map the response link. Consider mapping to a text or URL field in Salesforce.
- Select Specified Value.
- Paste in one of the following links. The first link has embedded data, while the second does not. Neither of these report links expire.
${srr://SingleResponseReportLink?ttl=0}
${srr://SingleResponseReportLink?ttl=0&edata=false}
- Select Save and preview your survey to test your workflow.
Chaining Response Mapping Tasks
After setting up a response mapping task, the ID of the newly created or modified object can be referenced in subsequent tasks. This allows you to set up a series of consecutive mappings of Salesforce objects.
- Follow the linked instructions to set up your first response mapping task.
- Click Add a task and add another response mapping task.
- Choose Contact as the Salesforce Object.
- Click Add new field and select AccountId as the Salesforce field.
- Choose T-ID 1 Salesforce > objectId from the {a} piped text menu.
The Salesforce task can also be chained to any other task which supports chaining. See Passing Information from One Task to Another for more details.
Incomplete Survey Responses & Response Mapping
When a Response in Progress is closed (either manually by a user, or automatically by Incomplete survey response settings), the data moves into Recorded Responses. Whether this response triggers a Response Mapping or not depends on whether there is a condition applied to the mapping.
- If the mapping is set up with a condition, incomplete responses that meet those conditions will trigger a Response Mapping.
- If the mapping is set up without a condition, incomplete responses will never trigger a Response Mapping.
For more information on using logic to set up conditions, check out the page on using conditional logic.
Testing and Troubleshooting
To quickly ascertain and troubleshoot the field that is causing a mapping to fail, check the Workflows Reporting tab for that survey. This feature offers in-platform error logs that display the values being passed into each Salesforce field as well as the reason for the failure. Alternatively, you can set a Debug Email in your Response Mapping settings in Qualtrics. After Response Mapping runs, a Debug Email will send that confirms the mapping was successful, or explains why the attempt failed. You can also view individual fields and what Qualtrics is passing in the Debug Email, which may explain why the mapping isn’t behaving as expected.
THE MAPPING IS FAILING ENTIRELY
There are several possible causes for why a mapping will fail entirely (i.e., no fields are updated or no record is created, to name a few). Below are a few things to check when nothing is mapping:
- Make sure your account is properly linked. Note that the survey owner needs to be the one linked to the correct Salesforce instance. Try relinking your account.
- Check with your Salesforce Administrator to make sure there are no IP address login restrictions for your profile and that you have the necessary permissions (API enabled in Salesforce and read/write permissions on the necessary object).
- Make sure you have the proper Salesforce IDs if you are performing any mapping that requires a Key. This includes confirming the ID exists in your environment and that you are correctly mapping it over. For example, if you are mapping Embedded Data, check to make sure the field name given in the Survey Flow matches the field name given in the Response Mapping (spacing and capitalization does matter).
- Make sure that you are mapping over to any required fields in Salesforce. Some objects have required fields and will not let you save records that are missing those fields. For example, a lead may require an organization.
THE MAPPING IS SUCCESSFUL, BUT SOME FIELDS ARE MISSING
Some Salesforce objects require specific formats for certain fields. For example, a “Satisfaction Level” field may only accept a number 1 through 10. If you map the words “Extremely Satisfied” instead of a number 1 through 10, this field would not update correctly. See Mapping to Common Salesforce Fields for help in what you should be mapping.
It’s also possible that you don’t have permission to edit the fields you’re trying to map to. Check with your Salesforce Administrator to ensure you the necessary field-level permissions.